package com.cpi.cornpp.purchaseinstructiondetail.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.cpi.cornpp.customer.view.CustomerView;
import com.cpi.cornpp.instructionsforecasts.view.InstructionsForecastsDetailView;
import com.cpi.cornpp.product.view.ProductView;
import com.cs.common.utils.StringUtils;

public class InstructionPurchaseDetailView implements Serializable{
	private static final long serialVersionUID = 7814887149928788698L;
	private int purchaseInstructionDetailid;
	private String test; 
	private int purchaseInstructionId;
	private String row;
	private String itemQuantity;
	private String cornQuantity;
	private String futureTypeId;
	private String futureTypeDescription;
	private String futures;
	private String tons;
	private int instructionStrategyId;
	private String instructionStrategyDescription;
	private int instructionTypeId;
	private String instructionTypeDescription;
	private int status;
	private String statusDescription;
	private InstructionsForecastsDetailView instructionsForecastsDetailView;
	private List instructionsFuturesView;
	
	private CustomerView customerView;
	private CustomerView customerViewSearch;
	private Collection resultCustomerViews;
	private ProductView productViewSearch;
	private Collection productList;
	private String[] selectedProducts;
	private String currentCustomerId;
	List productViews;

	public InstructionPurchaseDetailView() {
		instructionsForecastsDetailView = new InstructionsForecastsDetailView();
		instructionsFuturesView = new ArrayList();
		customerView = new CustomerView();
	}
	
	
	public String getCornQuantity() {
		return cornQuantity;
	}

	public void setCornQuantity(String cornQuantity) {
		this.cornQuantity = cornQuantity;
	}

	public String getFutureTypeId() {
		return futureTypeId;
	}

	public void setFutureTypeId(String futureTypeId) {
		this.futureTypeId = futureTypeId;
	}
	
	public String getFutures() {
		return futures;
	}

	public void setFutures(String futures) {
		this.futures = futures;
	}

	public String getFutureTypeDescription() {
		return futureTypeDescription;
	}

	public void setFutureTypeDescription(String futureTypeDescription) {
		this.futureTypeDescription = futureTypeDescription;
	}

	public String getTons() {
		return tons;
	}

	public void setTons(String tons) {
		this.tons = tons;
	}

	public int getInstructionStrategyId() {
		return instructionStrategyId;
	}

	public void setInstructionStrategyId(int instructionStrategyId) {
		this.instructionStrategyId = instructionStrategyId;
	}

	
	public String getInstructionStrategyDescription() {
		return instructionStrategyDescription;
	}

	public void setInstructionStrategyDescription(
			String instructionStrategyDescription) {
		this.instructionStrategyDescription = instructionStrategyDescription;
	}

	public int getInstructionTypeId() {
		return instructionTypeId;
	}

	public void setInstructionTypeId(int instructionTypeId) {
		this.instructionTypeId = instructionTypeId;
	}
	
	public String getInstructionTypeDescription() {
		return instructionTypeDescription;
	}

	public void setInstructionTypeDescription(String instructionTypeDescription) {
		this.instructionTypeDescription = instructionTypeDescription;
	}

	public String getItemQuantity() {
		return itemQuantity;
	}

	public void setItemQuantity(String itemQuantity) {
		this.itemQuantity = itemQuantity;
	}

	public int getPurchaseInstructionDetailid() {
		return purchaseInstructionDetailid;
	}

	public void setPurchaseInstructionDetailid(int purchaseInstructionDetailid) {
		this.purchaseInstructionDetailid = purchaseInstructionDetailid;
	}

	public int getPurchaseInstructionId() {
		return purchaseInstructionId;
	}

	public void setPurchaseInstructionId(int purchaseInstructionId) {
		this.purchaseInstructionId = purchaseInstructionId;
	}

	public String getRow() {
		return row;
	}

	public void setRow(String row) {
		this.row = row;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getStatusDescription() {
		return statusDescription;
	}

	public void setStatusDescription(String statusDescription) {
		this.statusDescription = statusDescription;
	}
	

	
	public InstructionsForecastsDetailView getInstructionsForecastsDetailView() {
		return instructionsForecastsDetailView;
	}

	public void setInstructionsForecastsDetailView(
			InstructionsForecastsDetailView instructionsForecastsDetailView) {
		this.instructionsForecastsDetailView = instructionsForecastsDetailView;
	}

	public List getInstructionsFuturesView() {
		return instructionsFuturesView;
	}

	public void setInstructionsFuturesView(List instructionsFuturesView) {
		this.instructionsFuturesView = instructionsFuturesView;
	}

	public String getFullCustomerDescriptionShort(){
		StringBuffer fullCustomerDescription = new StringBuffer(StringUtils.EMPTY_STRING);
		fullCustomerDescription.append(this.customerView.getCustomerId());
		fullCustomerDescription.append(StringUtils.SLASH_CHAR);
		fullCustomerDescription.append(this.customerView.getDescription());
		if(fullCustomerDescription.length()>28){
			return fullCustomerDescription.substring(0, 27)+ "...";
		}		
		return fullCustomerDescription.toString();
		
	}
	
	public String getFullProductDescriptionShort(){
		StringBuffer fullProductDescription = new StringBuffer(StringUtils.EMPTY_STRING);
		//TODO Regresar listado de productos ( codigo - descripcion\n )
		return fullProductDescription.toString();
		
	}


	public String getTest() {
		return test;
	}


	public void setTest(String test) {
		this.test = test;
	}


	public CustomerView getCustomerView() {
		return customerView;
	}


	public void setCustomerView(CustomerView customerView) {
		this.customerView = customerView;
	}


	public CustomerView getCustomerViewSearch() {
		return customerViewSearch;
	}


	public void setCustomerViewSearch(CustomerView customerViewSearch) {
		this.customerViewSearch = customerViewSearch;
	}


	public ProductView getProductViewSearch() {
		return productViewSearch;
	}


	public void setProductViewSearch(ProductView productViewSearch) {
		this.productViewSearch = productViewSearch;
	}


	public Collection getProductList() {
		return productList;
	}


	public void setProductList(Collection productList) {
		this.productList = productList;
	}

	public Collection getResultCustomerViews() {
		return resultCustomerViews;
	}

	public void setResultCustomerViews(Collection resultCustomerViews) {
		this.resultCustomerViews = resultCustomerViews;
	}


	public String[] getSelectedProducts() {
		return selectedProducts;
	}


	public void setSelectedProducts(String[] selectedProducts) {
		this.selectedProducts = selectedProducts;
	}


	public String getCurrentCustomerId() {
		return currentCustomerId;
	}


	public void setCurrentCustomerId(String currentCustomerId) {
		this.currentCustomerId = currentCustomerId;
	}

}
